from django.http import HttpResponse
from django.shortcuts import render
from datetime import datetime
def greet(word):
    return 'hello world %s' % word

def index(request):
    context = {
        'greet':greet
    }
    return render(request,'index.html',context=context)

def add_view(request):
    context = {
        'value1': ['1','2','3'],
        'value2': ['4','5',6]
    }
    return render(request, 'add.html', context=context)

def cut_view(request):
    return render(request, 'cut.html')

def date_view(request):
    context = {
        'today':datetime.now()
    }
    return render(request, 'date.html',context=context)

def default_view(request):
    context = {
        # 'value':''
        'value':None
    }
    return render(request, 'default.html', context=context)


def first_view(request):
    context = {
        # 'value':''
        'value':['湖北wangfan','周瑜','屈原']
    }
    return render(request, 'first.html', context=context)

def floatformat_view(request):
    context = {
        # 'value':''
        'value':3.141592654
    }
    return render(request, 'floatformat.html', context=context)


def join_view(request):
    context = {
        # 'value':''
        # 'value':[1,2,3,4]
        # 'value':'我今天学会了好多撩妹的话说给你听啊'
        # 'value':'WTF'
        # 'value':['1','a',3,6,9]
        # 'value':'<script>alert("你属什么的 错 你属于我")</script>'
        # 'value': ['1', 'a', 3, 6, 9]
        #'value':'<script>alert("你属什么的 错 你属于我")</script>'
        'value':'<p>武大欢迎您</p>'
    }
    return render(request, 'join.html', context=context)